package com.wl.application.controller;

import com.alibaba.nacos.api.exception.NacosException;
import com.wl.application.feign.api.Server2Api;
import org.checkerframework.checker.units.qual.A;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author wl
 * @version 1.0
 * @date 2022/7/21
 * @description:
 */
@RestController
@RequestMapping("/server1")
public class ProviderController {

    @Autowired
    private RabbitTemplate rabbitTemplate;
    @Autowired
    private Server2Api server2Api;
    @GetMapping("/test")
    public String serverText(){
        String info=server2Api.serverText();
        return "server服务1:::"+System.currentTimeMillis()+info;
    }
    @GetMapping("/info")
    public String info(){
        rabbitTemplate.convertAndSend("","wl","name");
        return "info";
    }
    @GetMapping("/timeout")
    public String timeout(){
        String timeout = server2Api.timeout();
        return "timeout";
    }
}
